package jw3.c7.controller;

import jw3.c7.model.User;
import jw3.c7.utils.QueryByClass;
import jw3.c7.model.User;
import jw3.c7.utils.QueryByClass;

import java.util.List;

public class Usercontroller {
public static boolean login(String user, String pwd){
    try {
        QueryByClass<User> queryByClass=new QueryByClass<User>();
        String sql="select * from user where zh=? and pwd=?";
        List<User> list= queryByClass.select(User.class,sql,user,pwd);
        return list.size()>0;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return false;
}
public static boolean wj(String us){
    try {
        QueryByClass<User> queryByClass=new QueryByClass<User>();
        String sql = "select * from user where zh=?";
        List<User> list= queryByClass.select(User.class,sql,us);
        return list.size()>0;
    } catch (Exception e) {
        e.printStackTrace();
    }

return false;
}

}
